function vali = validateModel(     feat_test, score_test, ...
                                    model, ...
                                    predict_method)
                        
vali.score_res = predict_method( model, feat_test );

diff = (vali.score_res - score_test);
vali.mse = mean(mean( diff.^2 ));

frame_n = size( score_test, 1 );

max_k_vali = 20;

mean_score_res = zeros( frame_n , max_k_vali );
mean_score_lab = zeros( frame_n , max_k_vali );
hit_num = zeros( frame_n , max_k_vali );
pick_id = zeros( frame_n , max_k_vali );
best_pick_id = zeros( frame_n , max_k_vali );

for i = 1: frame_n 
    [~,sort_lab] = sort( - score_test( i, : ) );
    [~,sort_res] = sort( - vali.score_res( i, : ));
    
    pick_id(i,:) = sort_res( 1:max_k_vali );
    best_pick_id(i,:) = sort_lab( 1:max_k_vali );
    
    sum_lab = 0;
    sum_res = 0;
    
%     if i==1
%         sort_lab(1:max_k_vali)
%         score_test( i, sort_lab(1:max_k_vali) )
%     end
    
    for j = 1 : max_k_vali         
        id_lab = sort_lab(j);
        id_res = sort_res(j);
        
        sum_lab = sum_lab + score_test( i, id_lab );
        sum_res = sum_res + score_test( i, id_res );
        
%         if i==1
%             disp([num2str(id_lab) ' ' num2str(score_test( j, id_lab )) ' ' num2str(sum_lab)])
%         end
                
        mean_score_lab(i, j ) = sum_lab / j;        
        mean_score_res(i, j ) = sum_res / j;
    end
    
end

vali.mean_score_res_mat = mean_score_res;
vali.mean_score_lab_mat = mean_score_lab;
vali.hit_num = hit_num;
vali.pick_id = pick_id;
vali.best_pick_id = best_pick_id;

vali.mean_score_res = mean( mean_score_res );
vali.mean_score_lab = mean( mean_score_lab );